<div ng-controller="incomeListCtrl">
    <div class="table-header mt5 clearfix ng-scope">
        <span class="fl lh30 f14">收入信息</span>
    </div>
    <div>
        <my-nav data-nav-items="filterConfirmType" onchanged="changeConfirmType" data-title="确认方式:"></my-nav>
        <my-nav data-nav-items="filterIncomeResource" onchanged="changeIncomeResource" data-title="收入来源:" ng-if="incomeType=='incomehaveconfirm' || incomeType=='incomewaitconfirm'"></my-nav>
    </div>
    <div class="section-table mt20">
        <div class="table-header lh30 pb5 clearfix">
            <span class="fl f14">收入项信息</span>

            <div class="fr btn-group">
                <input type="text" class="fl input-text w200 ml3" placeholder="客户信息/收入编码" ng-model="query.keyword"
                       ng-enter="query.execute()">
                <button class="btn" ng-click="query.execute()">查询</button>
                <button ng-if="incomeType == 'incomewaitconfirm'" class="btn btn-yellow" ng-click="carryover()" title="收入结转"
                        ui-dialog="收入结转"
                        ui-dialog-data="{}"
                        ui-dialog-show="incomeService.onCarryoverShow($data,$dialog,$dialogScope)"
                        ui-dialog-cache="false"
                        ui-dialog-url="/income/carryover.html">
                    收入结转</button>
                <button class="btn btn-yellow" ng-click="export()" title="导出未结算合同">导出excel</button>
            </div>
        </div>
        <div class="table-wrap mh500 mt10">
            <table class="table">
                <thead>
                <tr>
                    <th style="width: 40px;text-align: center;">序号</th>
                    <th style="width: 150px;">客户信息</th>
                    <th style="width: 200px;">签约信息</th>
                    <th style="width: 130px;">收入结转时间</th>
                    <th style="width: 130px;">收入项</th>
                    <th style="width: 130px;">收入金额</th>
                    <th style="width: 130px;">确认金额</th>
                    <th style="width: 100px;" ng-if="incomeType=='incomehaveconfirm' || incomeType=='incomewaitconfirm'">收入来源</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="record in incomes" class="table-tr">
                    <td style="text-align: center"><p ng-bind="$index + 1 + startPageIndex"></p></td>
                    <td>
                        <p ng-bind="record.cstname"></p>
                    </td>
                    <td>
                        <p class="c9">合同编码：{{record.contract_code}}</p>

                        <p class="c9">所属区域：{{record.area_name}}</p>

                        <p class="c9">签约日期：{{record.sign_date | strdate:'yyyy-MM-dd'}}</p>

                        <p class="c9">录入日期：{{record.sign_date | strdate:'yyyy-MM-dd'}}</p>
                    </td>
                    <td>
                        <p class="c9">结转开始日期：{{record.sign_date | strdate:'yyyy-MM-dd'}}</p>

                        <p class="c9">权益日期：{{record.right_begin_time | strdate:'yyyy-MM-dd'}}至{{record.right_end_time | strdate:'yyyy-MM-dd'}}</p>
                    </td>
                    <td>
                        <p>{{record.income_code}}</p>

                        <p class="c9">核算收入类别：{{record.type_name}}</p>

                        <p class="c9">确认方式：{{record.confirm_type_name}}</p>
                    </td>
                    <td>
                        <p>收入金额：{{record.amount | number:2}}</p>
                    </td>
                    <td>
                        <p class="c9">累计已确认收入：{{record.total_confirm_amount | number:2}}</p>
                        <p class="c9">待确认收入：{{record.wait_confirm_amount | number:2}}</p>
                        <p class="c9">本期确认收入：{{record.this_period_confirm_amount | number:2}}</p>
                    </td>
                    <td ng-if="incomeType=='incomehaveconfirm' || incomeType=='incomewaitconfirm'">
                        <p>{{record.income_source}}</p>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="no-data" ng-if="incomes.length==0"><span>暂无数据</span></div>
        </div>
        <div id="pagination" class="pagination"></div>
    </div>
</div>
